from PyPDF2 import PdfFileWriter, PdfFileReader

output = PdfFileWriter()
input1 = PdfFileReader(open('document1.pdf', 'rb'))

print('document1.pdf has %d pages' % input1.getNumPages())
